<!--
 * @Author: 邱狮杰
 * @Date: 2021-09-04 21:03:03
 * @LastEditTime : 2021-09-07 18:39:53
 * @FilePath     : /newhope/src/components/permissionButton/index.vue
 * @Description: 描述
-->
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { useStore } from "vuex";
import { useGo } from "/@/hooks/go";
import gameInstructions from "/@/assets/images/gameInstructions.png"; // 奥特兰牛奶 10元优惠卷
import subcodeRedemptionCodeButton from "/@/assets/images/getInfoButton.png"; // 获取兑换码button
import receive from "/@/assets/images/receive.png";
const store = useStore();
const isItPerfect = ref(store.getters["user/getIsTheInformationComplete"]);
const [go] = useGo();
// onMounted(() => {
//   console.log(store.getters["user/getIsTheInformationComplete"]);
// });
function receiveGet() {
  // alert("领取成功");
  location.href = store.state.user.myawards[0].value
  // go({ name: "index" });
}
function getInfo() {
  go({ name: "info" });
}
</script>
<template>
  <img v-if="!isItPerfect" @click="receiveGet" :src="receive" alt="receive" class="doawButton" />
  <img
    v-else
    @click="getInfo"
    :src="subcodeRedemptionCodeButton"
    alt="subcodeTencentVideo"
    class="subcodeRedemptionCodeButton"
  />
</template>
<style lang="scss" scoped>
.subcodeRedemptionCodeButton {
  position: absolute;
  top: 581px;
  left: 50%;
  transform: translateX(-50%);
  width: 205px;
  height: 42px;
  z-index: 101;
}
.doawButton {
  width: 152px;
  height: 36px;
  position: absolute;
  top: 581px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 101;
}
</style>
